package com.spt.ws.tasks.impl;


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.spt.core.TaskAnnotation;
import com.spt.ws.dao.IDataclean;
import com.spt.ws.tasks.ITask;

@Component(value="cleanDataBean")
@TaskAnnotation (job_name = "数据清理",  task_id="sys_data_clean", group_id="system_utility", cron="0 45 13 * * ?", autoRun="N")
public class CleanDataTask implements ITask {
    private static Logger log = LogManager.getLogger("com.spt.ws.dao.impl.dataCleanImpl");
    @Autowired
    private IDataclean dao;
    

    @Override
    public void doTask(){
        log.info("开始数据清理 ..........");
        try {
            /*dao.cleanWrokData();
            dao.cleanHisData();
            dao.datadelete();*/
            log.info("start ..........");
            dao.cleanData();
        }catch(Exception e) {
            log.info("data clean error: " + e.getMessage());
        }
        
        log.info("数据清理结束..........");
    }

}
